/*
 * @Author: 小花
 * @Date: 2022-04-07 09:10:37
 * @LastEditors: 小花
 * @LastEditTime: 2022-05-16 16:12:23
 * @FilePath: /vue3-teap/src/plugins/request/responseUtil.ts
 * @Description:
 */
export enum responseEnum {
  /**
   * 请求成功
   */
  OK = 43000,
  /**
   * 请求失败
   */
  FAIL = 43001,
  /**
   * 参数有误
   */
  PARAMS_ERROR = 43002,
  /**
   * 暂无权限
   */
  NO_PERMISSION = 43003,
  /**
   * 账号或密码错误
   */
  LOGIN_INFO_ERROR = 43006,
  /**
   * 登录失效
   */
  LOGIN_FAILURE = 43008,
  /**
   * 登录有效
   */
  LOGIN_VALID = 43009,
  /**
   * 登录成功
   */
  LOGIN_SUCCESS = 43010,
  /**
    * 注册成功
    */
  REGISTER_SUCCESS = 43011,
  /**
   * 登录已被顶下线
   */
  BE_REPLACED = 43012,
  /**
   * 登录已被踢下线
   */
  KICK_OUT = 43013,

  /**
   * socket发送数据
   */
  WEBSOCKET_DATA = 43014,
  /**
   * socket发送ping
   */
  WEBSOCKET_PING = 43015,
  /**
   * 关闭socket
   */
  CLOSE_WEBSOCKET = 43016
}

export type responseUtil<T = any> = {
  code: responseEnum,
  data: T,
  msg: string
}
